﻿@using Permissions
@using Abp.Web.Mvc.Extensions
@model Abp.Application.Services.Dto.ListResultDto<Permissions.PermissionssApp.Dto.PermissionssDto>

@{
    ViewBag.Title = "Permissionss";
}

<script src="~/Scripts/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#btnAdd").click(function () {
            location.href ="Create";
        })

        $("#btnPermissions").click(function () {
            var Id = $("input[name='role']:checked").val();
            if (Id == null || Id == "") {
                alert("请选择角色!");
            } else {
                location.href = "../Permissionss/Index/" + Id;
            }
        })
    })
</script>
<div>
    @*<button data-toggle="modal" data-target="#PersonCreateModal" class="btn btn-primary pull-right" id="btnPermissions" style="margin-left:15px;">
        <i class="fa fa-plus"></i> 角色权限设置
    </button>*@
    <button data-toggle="modal" data-target="#PersonCreateModal" class="btn btn-primary pull-right" id="btnAdd">
        <i class="fa fa-plus"></i> 新增权限
    </button>
    <table class="table">
        <tr>
            <th>权限编号</th>
            <th>菜单名称</th>
            <th>权限名称</th>
            <th>地址</th>
            <th></th>
        </tr>
        @foreach (var permissions in Model.Items)
        {
        <tr>
            <td><input type="checkbox" name="role" class="checknum" value="@permissions.Id" /> </td>
            <td>@permissions.Name</td>
            <td>@permissions.ResourceName</td>
            <td>@permissions.Address</td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = permissions.Id }) |
                @Html.ActionLink("Delete", "Delete", new { id = permissions.Id })
            </td>
        </tr>
        }
    </table>
</div>


